#include <iostream>
#include <unistd.h>
#include <sys/wait.h>
using namespace std;

int main()
{
    int ret = fork();
    if(ret < 0)
        cout<<"ER";
    if(ret > 0){
        cout<<"i am father, child id is "<<ret<<endl;
    }else{
        cout<<"i am child"<<endl;
    }
    ret = wait(NULL);
    cout<<ret;
    return 0;
}
